<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <style>
        body{
            width:960px;
            margin:auto;
        }
        .subject{
            margin: 20xp 20px;
        }
        .sname{
            font:bold 28px Arial;
        }
        a{
            color:blue;
            text-decoration:none;
            vertical-align:middle;
        }
         .nav {
            float: right;
            margin-top: 20px;
        }
        .nav+h2 {
            clear: both;
        }
    </style>
</head>
<body>
    <div class="nav">
        {% if request.session.username %}
        {{request.session.username}}
        <a href="/logout/">注销</a>
        {% else %}
        <a href="/login/">登录</a>
        {% endif %}&nbsp;
        <a href="">注册</a>
    </div>
    <h2>千峰教育成都学科</h2>
    <hr>
    {% for subject in subjects %}
    <div class="subject">
        <p class="sname">
            <a href="/teachers/?sno={{subject.no}}">{{ subject.name}}</a>
            &nbsp;&nbsp;&nbsp;&nbsp;
            {% if subject.is_hot %}
            <img src="static/images/hot-icon-small.png">
            {% endif %}
        </p>
        <p>
            <a>{{ subject.intro}}</a>
        </p>
    </div>
    {% endfor %}
</body>
</html>
